//
//  NCUIBundle.swift
//  ZZUI
//
//  Created by 张文晏 on 2018/10/26.
//  Copyright © 2018 张文晏. All rights reserved.
//

import UIKit

class NCUIBundle {
    static func image(_ named: String) -> UIImage? {
        let bundle = Foundation.Bundle(for: NCUIBundle.self)
        if
            let subBundleURL = bundle.url(forResource: "NCUIResources", withExtension: "bundle"),
            let subBundle = Bundle(url: subBundleURL),
            let image = UIImage(named: named, in: subBundle, compatibleWith: nil) {
            return image
        } else {
            return nil
        }
    }
}
